Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(s2n-quic-transport): decrement handshake count for non-accepted finalized connections #1911

Merged
merged 1 commit into from
Aug 14, 2023

Conversation

WesleyRosenblum
Copy link
Contributor

@WesleyRosenblum WesleyRosenblum commented Aug 11, 2023

Description of changes:

The count of currently handshaking connections in the connection container was not being decremented when a connnection moved from handshaking directly to finalizing. This change corrects this behavior.

Call-outs:

There is a brief moment between when update_interests() is called and finalize_done_connections() is called when the handshake_connections count is technically incorrect. This is because I decided to account for both handshaking connections and handshaking completed connections in the update_interests() method so I would not need to lock the connection multiple times. A connection that is handshaking and finalizing will decrement the handshake_connections count, but is not be removed from the connection map until finalize_done_connections is called. This meant I had to call finalize_done_connections() prior to ensure_counter_consistency(). I added some debug assertions in finalize_done_connections() to ensure the accounting is still correct.

Testing:

Updated the connection container fuzz test to trigger this scenario

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@WesleyRosenblum WesleyRosenblum merged commit c7e3f51 into main Aug 14, 2023
129 checks passed
@WesleyRosenblum WesleyRosenblum deleted the WesleyRosenblum/handshakecount branch August 14, 2023 17:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants